﻿using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.System;

/// <summary>
/// SSO应用配置表
/// </summary>
public class SysSsoApplication : BasePoco
{
    [Display(Name = "应用标识", Description = "SSO应用唯一标识符", GroupName = "基本信息")]
    [Required(ErrorMessage = "应用标识不能为空")]
    [StringLength(50)]
    public string AppId { get; set; }

    [Display(Name = "应用名称", Description = "SSO应用显示名称", GroupName = "基本信息")]
    [Required(ErrorMessage = "应用名称不能为空")]
    [StringLength(100)]
    public string AppName { get; set; }

    [Display(Name = "回调地址", Description = "SSO登录成功后的回调URL", GroupName = "配置信息")]
    [Required(ErrorMessage = "回调地址不能为空")]
    [StringLength(500)]
    [Url(ErrorMessage = "请输入有效的URL地址")]
    public string CallbackUrl { get; set; }

    [Display(Name = "是否启用", Description = "应用是否启用SSO功能", GroupName = "状态管理")]
    public bool? IsActive { get; set; } = true;

    [Display(Name = "描述", Description = "应用描述信息", GroupName = "基本信息")]
    [StringLength(500)]
    public string Description { get; set; }
}